package com.hspedu.wrapper;

/**
 * @author sp
 * @version 0.1
 */
public class WrapperExercise03 {
    public static void main(String[] args) {
        //示例1
        Integer i1 = new Integer(127);//构造器
        Integer i2 = new Integer(127);
        System.out.println(i1 == i2);//false

        //示例2
        Integer i3 = new Integer(128);
        Integer i4 = new Integer(128);
        System.out.println(i3 == i4);//false

        //示例3
        Integer i5 = 127;//Integer.valueOf(1);
        Integer i6 = 127;
        System.out.println(i5 == i6);//true

        //示例4
        Integer i7 = 128;//Integer.valueOf(1);
        Integer i8 = 128;
        System.out.println(i7 == i8);//false

        //示例5
        Integer i9 = 127;
        Integer i10 = new Integer(127);
        System.out.println(i9 == i10);//false

        //示例6
        Integer i11 = 127;//Integer.valueOf(127);
        int i12 = 127;
        System.out.println(i11 == i12);//true, 只要有基本数据类型，判断的是值是否相等

        //示例7
        Integer i13 = 128;
        int i14 = 128;
        System.out.println(i13 == i14);//true

    }
}
